package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func JsonRes(c *gin.Context, code int, message string, data interface{}) {
	if code == 200 {
		c.JSON(http.StatusOK, gin.H{"code": code, "data": data, "message": message})
	} else {
		c.JSON(http.StatusBadRequest, gin.H{"code": code, "data": data, "message": message})
	}
}
